package com.xrkol.sharelib.config;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;

import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.util.WebAppRootListener;

/**
 * 替代Web.xml 的配置代码
 */
public class DefaultConfigration implements WebApplicationInitializer {

	@Override
	public void onStartup(ServletContext context) throws ServletException {
		context.addListener(new ContextLoaderListener());
		context.addListener(new WebAppRootListener());
		context.setInitParameter("contextConfigLocation",
				"classpath*:**/*Context.xml");
		context.setInitParameter("webAppRootKey", "webRoot");
	}

}
